//
//  BlueManager.h
//  WealthGoods
//
//  Created by yisheng chen on 2023/11/28.
//

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
NS_ASSUME_NONNULL_BEGIN

@protocol BlueManagerDelegate <NSObject>

//获取列表数据
@optional
- (void)deviceList:(NSArray *)arr;

@end

@interface BlueManager : NSObject

@property (nonatomic,weak) id<BlueManagerDelegate> delegate;
+ (instancetype)shareInstance;

//开始扫描
- (void)startScan;
//停止扫描
- (void)stopScan;

//1.1 APP端发起更新(获取文件大小)
-(void)writeOneAndOneDevice;
//1.2 APP端回复数据指令(即继续传输文件data,每次最多只传384)
-(void)writeOneAndTwoDevice:(NSInteger)location;
//2.1 发起校验
-(void)writeTwoAndOneDevice;
//选中的蓝牙
- (void)selectPeripheral:(CBPeripheral *)peripheral;
//设置文件名字
- (void)setFileName:(NSString *)fileName;  //正式不用  本地数据自己调数据可能需要需要
//设置文件data
- (void)setBlueFileData:(NSData *)data;
//获取蓝牙外设
- (CBPeripheral *)getBluePeripheral;
@end

NS_ASSUME_NONNULL_END
